import { axios } from "../../utils/request";

const api = {
    info: "/personal/getUserInfo",
    save: "/personal/save",
    checkPwd: "/personal/checkPwd",
    savePwd: "/personal/savePwd",
    shareInfo: "/personal/getShareInfo",
    shareUserList: "/personal/getShareUserList",
    shareCrmList: "/personal/getShareCrmList",
    commissionRecord: "/personal/getCommissionRecord",
    withdrawalRecord: "/personal/getWithdrawalRecord",
    withdrawalCommission: "/personal/withdrawalCommission",
    updateWithdrawalStatus: "/personal/updateWithdrawalStatus",
    updateLoginPhone: "/personal/updateLoginPhone",
    getSignature: "/weXin/getSignature",
    updateUserType: "/personal/updateUserType",


    //离职
    bye: "/personal/quit",
};

/**
 * 获取用户个人信息
 */
export function getUserInfo (parameter) {
    return axios({
        url: api.info,
        method: "get",
        params: parameter
    });
}

/**
 * 保存个人信息
 */
export function save (parameter) {
    return axios({
        url: api.save,
        method: "post",
        data: parameter
    });
}

/**
 * 密码检测
 */
export function checkPwd (data) {
    return axios({
        url: api.checkPwd,
        method: "get",
        params: data
    });
}

/**
 * 保存密码
 */
export function savePwd (data) {
    return axios({
        url: api.savePwd,
        method: "post",
        data: data
    });
}

/**
 * 获取分享信息
 */
export function shareInfo (data) {
    return axios({
        url: api.shareInfo,
        method: "get",
        params: data
    });
}

/**
 * 获取下级个人会员列表
 */
export function shareUserList (data) {
    return axios({
        url: api.shareUserList,
        method: "get",
        params: data
    });
}

/**
 * 获取下级公司会员列表
 * 
 */
export function shareCrmList (data) {
    return axios({
        url: api.shareCrmList,
        method: "get",
        params: data
    });
}

/**
 * 佣金记录
 */
export function commissionRecord (data) {
    return axios({
        url: api.commissionRecord,
        method: "get",
        params: data
    });
}

/**
 * 提现记录
 */
export function withdrawalRecord (data) {
    return axios({
        url: api.withdrawalRecord,
        method: "get",
        params: data
    });
}

/**
 * 提现
 */
export function withdrawalCommission (data) {
    return axios({
        url: api.withdrawalCommission,
        method: "get",
        params: data
    });
}

/**
 * 修改提现状态
 */
export function updateWithdrawalStatus (data) {
    return axios({
        url: api.updateWithdrawalStatus,
        method: "post",
        data: data
    });
}

/**
 * 修改登录手机号
 */
export function updateLoginPhone (data) {
    return axios({
        url: api.updateLoginPhone,
        method: "post",
        data: data
    });
}

/**
 * 获取微信签名
 */
export function getSignature (data) {
    return axios({
        url: api.getSignature,
        method: "get",
        params: data
    });
}

/**
 * 修改用户类型 //升级为单位用户
 */
export function updateUserType (data) {
    return axios({
        url: api.updateUserType,
        method: "get",
        params: data
    });
}

//推客关系图数据
export function getShareUserAll (data) {
    return axios({
        url: '/personal/getShareUserAll',
        method: "get",
        params: data
    });
}

//离职
export function byebye (data) {
    return axios({
        url: api.bye,
        method: "get",
        params: data
    });
}

//单位转成个人用户

export function updateCompanyType (data) {
    return axios({
        url: "/personal/updateCompanyType",
        method: "get",
        params: data,
        timeout:60000
    });
}

